<template>
	<view class="subject">
		<MyHeader title="刷题"></MyHeader>
		<view class="subject-content">
			<view class="subject-common">
				<!-- 定义计数 -->
				<view class="dots">
					<text>1/20</text>
				</view>
				<!-- 中间滑动内容 -->
				<swiper>
					<swiper-item>
						<scroll-view scroll-y="true" >
							<!-- 每道题的组件 -->
							<Subject></Subject>
						</scroll-view>
					</swiper-item>
				</swiper>
			</view>
		</view>
		<view class="subject-check">
			<view class="back">上一题</view>
			<view class="next">下一题</view>
		</view>
	</view>
</template>

<script>
	import MyHeader from '../../Common/My-header/my-header.vue'
	import Subject from '../../Component/subject/subject.vue'
	import {questionsTotal} from '../../Service/question.js'
	export default{
		data(){
			return{
				typeId:0
			}
		},
		components:{
			MyHeader,
			Subject
		},
		onLoad(options) {
			this.typeId = options.typeId,
			console.log(this.typeId)
			this.getTotal()
		},
		methods:{
			async getTotal(){
				const data = {
					typeId:this.typeId
				}
				const res = await questionsTotal[data]
				console.log(res)
			}
		}
		
	}
</script>

<style scoped>
	scroll-view::-webkit-scrollbar{
		display: none;
		width: 0 !important;
		height: 0 !important;
		background: transplant;
	}
	swiper{
		height: auto;
	}
	.subject{
		position: relative;
		width: 100vw;
		background-color: #f0f7f3;
		box-sizing: border-box;
	}
	.subject-content{
		padding: 0 37rpx;
		width: 100%;
		box-sizing: border-box;
	}
	.dots{
		height: 30rpx;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #344356;
		opacity: .6;
	}
	.subject-common{
		padding-bottom: 50rpx;
	}
	.subject-check{
		position: fixed;
		left: 0;
		bottom: 0;
		display: flex;
		justify-content: space-around;
		align-items: center;
	}
	.subject-check view{
		width: 311rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		color: #FFFFFF;
		border-radius: 40rpx;
		margin-left: 55rpx;
		background-color: rgba(90,103,247);
	}
	.next{
		background-color: rgba(90,139,245);
	}
</style>
